# -*- coding:utf-8 -*-


from flask_script import Manager, Command
from flask_migrate import Migrate, MigrateCommand
from Base import create_app, db

from gevent import pywsgi



app = create_app()



manager = Manager(app)
Migrate(app, db)



# class RunServer(Command):
#     def run(self):
#         host = "127.0.0.1"
#         port = 10003
#         print("服务启动", host, port)
#         server = pywsgi.WSGIServer((host, port), app)
#         server.serve_forever()



manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    manager.run()
